-- check_game_status
--
local import = import
---@type behavior_ret
local bret = import("bt/bt_plugin/behavior3/behavior_ret")
---@type login_res
local login_res = import("game/resources/login_res")
local M = {
    name = "check_game_status",
    type = "Condition",
    desc = "检查游戏状态",
    args = {
        { "valName", "string", "状态名" }
    },
}

function M.run(node, env, value)
    local ctx = env.ctx
    local val = login_res[node.args.valName]
    if ctx.gameStatus == val then
        return bret.SUCCESS
    end
    return bret.FAIL
end

return M
